package com.retain.system.vo;

import com.retain.system.dto.ResourceDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: LiuWei
 * @date: Create in 16:26 2018/12/27
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResourceVO {

    private Long id;

    private String resourceName;

    private String url;


    public static final ResourceVO buildResourceVO(final ResourceDTO resourceDTO) {
        if (resourceDTO != null) {
            return new ResourceVO(resourceDTO.getId(), resourceDTO.getResourceName(), resourceDTO.getUrl());
        }

        return null;
    }
}
